
package org.apache.ocean;

import org.apache.lucene.util.*;
import org.apache.lucene.search.*;

/**
 *
 * @author  jason rutherglen
 */
 final class ScorePriorityQueue extends PriorityQueue {
  ScorePriorityQueue(int size) {
    initialize(size);
  }
  
  protected final boolean lessThan(Object o1, Object o2) {
    ScoreDoc sd1 = (ScoreDoc)o1;
    ScoreDoc sd2 = (ScoreDoc)o2;
    // use index order as a tiebreaker to make sorts stable
    return sd1.score < sd2.score || (sd1.score == sd2.score && sd1.doc > sd2.doc);
  }
}